{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e91d42f0",
   "metadata": {},
   "source": [
    "# OpenAI Experimental Results\n",
    "\n",
    "Load results for experiments in original paper (make sure to download result files)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "af4e76b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from data.completion_dataset import CompletionIdentifier, CompletionDataset\n",
    "from data.split import load_train_test_split\n",
    "from evaluation.evaluator import Evaluator\n",
    "from evaluation.summary import summarize_evaluation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5033babe",
   "metadata": {},
   "outputs": [],
   "source": [
    "base_model = \"curie\"\n",
    "dataset_key = \"multiarith\"\n",
    "train_key = \"zs_cot\"\n",
    "e = None\n",
    "\n",
    "ci = CompletionIdentifier(base_model, \"ft_cot\", dataset_key, train_key, e)\n",
    "cd = CompletionDataset.load(ci)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "284e9156",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'accuracy': 0.3333333333333333,\n",
       " 'contains_answer': 0.3333333333333333,\n",
       " 'correct_format': 1.0,\n",
       " 'complete': 1.0}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train, test = load_train_test_split(dataset_key)\n",
    "evaluation = Evaluator.evaluate_completion_dataset(cd, test,)\n",
    "summarize_evaluation(evaluation)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
